/*
 * @Author: xuhua
 * @Date: 2023-09-19 10:23:59
 * @LastEditors: xuhua
 * @LastEditTime: 2023-09-19 10:24:00
 * @FilePath: /v3-element-admin/mock/utils.ts
 * @Description:
 */
import { ResultEnum } from "../src/enums/httpEnum";

export interface RequestParams {
	methods: string;
	body: any;
	headers?: { authorization?: string };
	query: any;
}

export const resultSuccess = (data: any = null, message = "请求成功") => {
	return {
		code: ResultEnum.SUCCESS,
		data,
		message,
	};
};

export const resultError = (message = "请求失败") => {
	return {
		code: ResultEnum.ERROR,
		data: null,
		message,
	};
};
